﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true" assembly="Mani.Patient.Business" namespace="Mani.Patient.Business.Domain.Entity">
  <class name="Patient" table="Patients">

    <id name="Id" type="Int32">
      <generator class="native" />
    </id>

    <one-to-one class="File" name="File" cascade="all" />
    <property name="PatientName" column="PatientName" type="String" not-null="true" length="100" />
    <property name="NationalCode" column="NationalCode" type="String" length="15" />
    <property name="IdNumber" column="IdNumber" type="Int32" not-null="false" />
    <property name="BirthDate" column="BirthDate" type="DateTime" not-null="false" />
    <property name="FatherName" column="FatherName" type="String" length="100" />
    <property name="Tel" column="Tel" type="String" length="20" />
    <property name="EmailAddress" column="EmailAddress" type="String" length="30" />
    <property name="Address" column="Address" type="String" length="100" />
    <property name="Picture" column="Picture" type="BinaryBlob" length="100" />
    <property name="Familiarity" column="Familiarity" type="String" length="100" />
    <property name="VIP" column="VIP" type="Boolean" />
    <property name="SubmitDate" column="SubmitDate" not-null="true" type="DateTime" />
    <property name="Description" column="Description" type="String" length="4000" />

    <bag name="Visits" lazy="true" cascade="delete" table="Visits">
      <key foreign-key="Patient" column="PatientId" />
      <one-to-many class="Visit" />
    </bag>
  </class>
</hibernate-mapping>